package com.hyt.it.ogt.kq.common.gov.enums;

import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

/**
 * canal同步库表
 */
@Getter
public enum CanalMonitorTableEnum {

    KW_CANDIDATE("kw_candidate", "考生表");

	private String table;
	private String tableDesc;

	private CanalMonitorTableEnum(String table, String tableDesc) {
		this.table = table;
		this.tableDesc = tableDesc;
	}
	
	public static CanalMonitorTableEnum getEnuByTableName(String tableName) {
		if(StringUtils.isEmpty(tableName)) {
			return null;
		}
		
		for (CanalMonitorTableEnum canalMonitorTableEnum : CanalMonitorTableEnum.values()) {
			if(canalMonitorTableEnum.getTable().equals(tableName)) {
				return canalMonitorTableEnum;
			}
		}
		
		return null;
	}
}
